import subprocess
import os

chainlit_ui_process = subprocess.Popen(
    ['python', '-m', 'chainlit', 'run', '100_roles.py', '--host', '0.0.0.0', '--port', '7860', "--ci", "--headless", "-w"])

try:
    chainlit_ui_process.wait()
finally:
    chainlit_ui_process.kill()
    print("Servers shut down.")
